package com.example.logsdemo.service2;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class DemoService2 {

    private static final Logger logger = LoggerFactory.getLogger(DemoService2.class);

    public String process(String input) {
        logger.debug("Start process, input={}", input);
        String output = input == null ? "" : input.trim().toUpperCase();
        logger.info("Processed output={}", output);
        return output;
    }

    public void simulateError() {
        try {
            throw new IllegalStateException("Simulated failure in service2");
        } catch (Exception ex) {
            logger.error("Service2 encountered an error", ex);
        }
    }
}


